<!--#
 @version 0.3 (auto-set)
#-->
<!-- Table 'commands' edit -->

<ul class="breadcrumb">
<li> 
<a href="?"><#LANG_HOME#></a>
</li>
[#if HISTORY#]
[#begin HISTORY#]
<span class="divider">/</span>
<li>
<a href="?view_mode=edit_commands&id=[#ID#]">[#TITLE#]</a> 
</li>
[#end HISTORY#]
[#endif HISTORY#]
[#if ID!=""#]
<span class="divider">/</span>
<li class="active">
[#TITLE#]
</li>
[#endif#]
</ul>

<form action="?" method="post" class="form-horizontal" enctype="multipart/form-data" name="frmEdit">
[#if OK#]

<div class="alert alert-success">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<#LANG_DATA_SAVED#>
</div>

[#endif OK#]
[#if ERR#]

<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<#LANG_FILLOUT_REQURED#>
</div>

[#endif ERR#]
[#if ID=""#]

<b><#LANG_NEW_RECORD#></b>

[#else ID#]
<div class="control-group">
        <label class="control-label">ID</label>
        <div class="controls">
                <input type="text" value="[#ID#]" disabled>

[#if TYPE="button"#]
Action URL:
<a href="/menu.html?ajax=1&op=value_changed&new_value=1&item_id=[#ID#]" target=_blank>Run</a>
[#endif#]


        </div>
</div>

[#endif ID#]
<div class="control-group">
        <label class="control-label"><#LANG_PARENT_MENU_ITEM#></label>
        <div class="controls">
                <select name="parent_id">
                <option value="0">ROOT
                [#begin PARENTS#]
                <option value="[#ID#]"[#if ID="<#PARENT_ID#>"#] selected[#endif#]>[#TITLE#]
                [#end PARENTS#]
                </select>
        </div>
</div>

<!-- TITLE (varchar) -->

<div class="control-group">
        <label class="control-label"><#LANG_TITLE#> (*)</label>
        <div class="controls">
                <input type="text" name="title" value="[#TITLE#]" size="50" required="true">
        </div>
</div>



<div class="control-group">
        <label class="control-label"><#LANG_PRIORITY#></label>
        <div class="controls">
                <input type="text" name="priority" value="[#PRIORITY#]" size="5">
        </div>
</div>

[#if EXT_ID=="" || EXT_ID="0"#]

<div class="control-group">
        <label class="control-label"><#LANG_TYPE#></label>
        <div class="controls">
                <select name="type">
                        <option value="">select
                        <option value="label"[#if TYPE="label"#] selected[#endif#]><#LANG_LABEL#>
                        <option value="window"[#if TYPE="window"#] selected[#endif#]><#LANG_NEW_WINDOW#>
                        <option value="url"[#if TYPE="url"#] selected[#endif#]><#LANG_URL#>
                        <option value="command"[#if TYPE="command"#] selected[#endif#]><#LANG_JS_COMMAND#>
                        <option value="button"[#if TYPE="button"#] selected[#endif#]><#LANG_BUTTON#>
                        <option value="switch"[#if TYPE="switch"#] selected[#endif#]><#LANG_ON_OFF_SWITCH#>
                        <option value="selectbox"[#if TYPE="selectbox"#] selected[#endif#]><#LANG_SELECT_BOX#>
                        <option value="sliderbox"[#if TYPE="sliderbox"#] selected[#endif#]><#LANG_SLIDER_BOX#>
                        <option value="plusminus"[#if TYPE="plusminus"#] selected[#endif#]><#LANG_PLUS_MINUS_BOX#>
                        <option value="timebox"[#if TYPE="timebox"#] selected[#endif#]><#LANG_TIME_PICKER#>
                        <option value="textbox"[#if TYPE="textbox"#] selected[#endif#]><#LANG_TEXT_BOX#>
                        <!--#
                        <option value="datebox"[#if TYPE="datebox"#] selected[#endif#]>(n/a) Date Picker
                        #-->
                        <option value="custom"[#if TYPE="custom"#] selected[#endif#]><#LANG_CUSTOM_HTML_BOX#>
                </select>
        </div>
</div>


<div class="control-group">
        <label class="control-label"><#LANG_ICON#></label>
        <div class="controls">
                <input type="file" name="icon">
        <p class="help-block">
                [#if ICON!=""#]
                <label class="checkbox">
                <input type="checkbox" name="delete_icon" value="1"><#LANG_DELETE#>
                </label>
                <img src="/cms/icons/[#ICON#]" border="0">
                [#ICON#]<br>
                [#endif#]
        </p>
        </div>
</div>

[#if TYPE=="plusminus" || TYPE=="sliderbox"#]

<div class="control-group">
        <label class="control-label"><#LANG_MIN_VALUE#></label>
        <div class="controls">
                <input type="text" name="min_value" value="[#MIN_VALUE#]" size="20">
        </div>
</div>

<div class="control-group">
        <label class="control-label"><#LANG_MAX_VALUE#></label>
        <div class="controls">
                <input type="text" name="max_value" value="[#MAX_VALUE#]" size="20">
        </div>
</div>

<div class="control-group">
        <label class="control-label"><#LANG_STEP_VALUE#></label>
        <div class="controls">
                <input type="text" name="step_value" value="[#STEP_VALUE#]" size="20">
        </div>
</div>

[#endif TYPE#]

[#if TYPE=="selectbox" || TYPE=="custom"#]

<div class="control-group">
        <label class="control-label"><#LANG_DATA#></label>
        <div class="controls">
                <textarea name="data" cols="50" rows="5">[#DATA#]</textarea>
        </div>
</div>

[#endif TYPE#]

<div class="control-group">
        <label class="control-label"><#LANG_AUTO_UPDATE_PERIOD#></label>
        <div class="controls">
                <input type="text" name="auto_update" value="[#AUTO_UPDATE#]" size="10"> (seconds) 
        </div>
</div>

[#if TYPE=="plusminus" || TYPE=="sliderbox"  || TYPE=="selectbox" || TYPE=="switch" || TYPE=="timebox" || TYPE=="textbox"#]

<div class="control-group">
        <label class="control-label"><#LANG_CURRENT_VALUE#></label>
        <div class="controls">
                <input type="text" name="cur_value" value="" size="20"> (<b>[#CUR_VALUE#]</b>)
        </div>
</div>

[#endif TYPE#]

[#if TYPE=="plusminus" || TYPE=="sliderbox"  || TYPE=="selectbox" || TYPE=="switch" || TYPE=="custom" || TYPE=="timebox" || TYPE=="textbox"#]

<div class="control-group">
        <label class="control-label"><#LANG_LINKED_OBJECT#>.<#LANG_PROPERTY#></label>
        <div class="controls">
                <input type="text" name="linked_object" value="[#LINKED_OBJECT#]" size="20">.<input type="text" name="linked_property" value="[#LINKED_PROPERTY#]" size="20">
        </div>
</div>

[#endif TYPE#]

[#if TYPE=="plusminus" || TYPE=="sliderbox" || TYPE=="selectbox" || TYPE=="button" || TYPE=="switch" || TYPE=="timebox" || TYPE=="textbox"#]

<div class="control-group">
        <label class="control-label"><#LANG_ONCHANGE_OBJECT#>.<#LANG_METHOD#></label>
        <div class="controls">
                <input type="text" name="onchange_object" value="[#ONCHANGE_OBJECT#]" size="20">.<input type="text" name="onchange_method" value="[#ONCHANGE_METHOD#]" size="20">
        </div>
</div>

<div class="control-group">
        <label class="control-label"><#LANG_ONCHANGE_SCRIPT#></label>
        <div class="controls">
<select name="script_id">
   <option value="0">
   [#begin SCRIPTS#]
       <option value="[#ID#]"[#if ID="<#SCRIPT_ID#>"#] selected[#endif#]>[#TITLE#]
       [#end SCRIPTS#]
</select> 
        </div>
</div>

<div class="control-group">
        <label class="control-label"><#LANG_ONCHANGE_CODE#> [#ERRORS#]</label>
        <div class="controls">
                <textarea name="code" rows="5" cols="50">[#CODE#]</textarea>
        </div>
</div>

[#endif TYPE#]

[#if TYPE="command"#]
<!-- COMMAND (varchar) -->

<#LANG_COMMAND#>
<input type="text" name="command" value="[#COMMAND#]" size="50">


[#endif TYPE#]

[#if TYPE=="window" || TYPE=="url" || TYPE==""#]
<!-- URL (varchar) -->

<div class="control-group">
        <label class="control-label"> <#LANG_URL#></label>
        <div class="controls">
                <input type="text" name="url" value="[#URL#]" size="50">
        </div>
</div>

[#if TYPE!="url"#]
<div class="control-group">
        <label class="control-label"><#LANG_TARGET_WINDOW#></label>
        <div class="controls">
                <input type="text" name="window" value="[#WINDOW#]" size="50">
        </div>
</div>

<!-- WIDTH (int) -->

<div class="control-group">
        <label class="control-label"><#LANG_WIDTH#></label>
        <div class="controls">
                <input type="text" name="width" value="[#WIDTH#]">
        </div>
</div>

<!-- HEIGHT (int) -->

<div class="control-group">
        <label class="control-label"><#LANG_HEIGHT#></label>
        <div class="controls">
                <input type="text" name="height" value="[#HEIGHT#]">
        </div>
</div>

[#endif TYPE#]
[#endif TYPE#]

[#endif EXT_ID#]

[#if (TYPE=="") || (ID=="")#]
<div class="control-group">
        <label class="control-label"><#LANG_EXT_ID#></label>
        <div class="controls">

                <select name="ext_id">
                <option value="0">
                [#begin PARENTS#]
                <option value="[#ID#]"[#if ID="<#EXT_ID#>"#] selected[#endif#]>[#TITLE#]
                [#end PARENTS#]
                </select>
                [#if EXT_ID!="0" && EXT_ID!=""#]<a href="?view_mode=edit_commands&id=[#EXT_ID#]">...</a>[#endif#]
        </div>
</div>
[#endif TYPE#]

<div class="control-group">
        <label class="control-label"><#LANG_VISIBLE_DELAY#></label>
        <div class="controls">
                <input type="text" name="visible_delay" value="[#VISIBLE_DELAY#]"> (<#LANG_SECONDS#>)
        </div>
</div>



<!--#
<tr>
 <td valign="top">&nbsp;</td>
 <td valign="top">
  <label><input type="checkbox" name="autostart" value="1"[#if AUTOSTART="1"#] checked[#endif#]> AUTOSTART</label>
 </td>
</tr>
#-->

<div class="form-actions">
[#if ID!=""#]
<button type="submit" class="btn" name="subm"><i class="icon-ok"></i> <#LANG_SUBMIT#></button>
[#else ID#]
<button type="submit" class="btn" name="subm"><i class="icon-plus-sign"></i> <#LANG_ADD#></button>
[#endif ID#]

<a class="btn" href="?"><#LANG_CANCEL#></a>

 [#if ID!=""#]
 <a class="btn" href="?id=<#ID#>&view_mode=clone_commands" onClick="return confirm('<#LANG_ARE_YOU_SURE#>')"><#LANG_MAKE_COPY#></a>
 [#endif ID#]

<input type="hidden" name="id" value="<#ID#>">
<input type="hidden" name="view_mode" value="<#VIEW_MODE#>">
<input type="hidden" name="edit_mode" value="<#EDIT_MODE#>">
<input type="hidden" name="mode" value="update">
</div>
</form>


[#if ID!=""#]
<hr>


<div class="row">
<div class="span-50">
   <#LANG_ON_THE_SAME_LEVEL#>:
   <ul>
   [#begin SAME_LEVEL#]
    <li>
    [#if ID!="<#ID#>"#]
    [#TITLE#] ([#if TYPE!=""#][#TYPE#],[#endif#] [#PRIORITY#])<span class="divider">/</span><a href="?view_mode=edit_commands&id=[#ID#]"><#LANG_EDIT#></a>
    [#else#]
    <b>[#TITLE#] ([#if TYPE!=""#][#TYPE#],[#endif#] [#PRIORITY#])</b>
    [#endif#]
    </li>
   [#end SAME_LEVEL#]
   </ul>
   <a href="?view_mode=edit_commands&parent_id=<#PARENT_ID#>&id="><button class="btn btn-mini btn-success"><i class="icon-plus-sign icon-white"></i> <#LANG_ADD#></button></a>
</div>
<div class="span-50">
   <b><#LANG_CHILD_ITEMS#>:</b>
   [#if CHILDREN#]
   <ul>
   [#begin CHILDREN#]
    <li>
    [#TITLE#] ([#if TYPE!=""#][#TYPE#],[#endif#] [#PRIORITY#])<span class="divider">/</span><a href="?view_mode=edit_commands&id=[#ID#]"><#LANG_EDIT#></a>
    </li>
   [#end CHILDREN#]
   </ul>
   [#else CHILDREN#]
   <p>n/a</p>
   [#endif CHILDREN#]
   <a href="?view_mode=edit_commands&parent_id=<#ID#>&id="><button class="btn btn-mini btn-success"><i class="icon-plus-sign icon-white"></i> <#LANG_ADD#></button></a>
</div>
</div>

<!--#
&nbsp;<br>
HTML code for templates:<br>
<b>[<span></span>#module name="commands" id="[#ID#]" action=""#<span></span>]</b>
#-->



[#endif#]
